
package com.bstek.urule.parse.deserializer;

import com.bstek.urule.model.library.variable.Variable;
import com.bstek.urule.parse.ParameterLibraryParser;
import org.dom4j.Element;

import java.util.List;

/**
 * @author Jacky.gao
 * @since 2015年3月10日
 */
public class ParameterLibraryDeserializer implements Deserializer<List<Variable>> {
    public static final String BEAN_ID = "urule.parameterLibraryDeserializer";
    private ParameterLibraryParser parameterLibraryParser;

    @Override
    public List<Variable> deserialize(Element root) {
        return parameterLibraryParser.parse(root);
    }

    @Override
    public boolean support(Element root) {
        return parameterLibraryParser.support(root.getName());
    }

    public void setParameterLibraryParser(
            ParameterLibraryParser parameterLibraryParser) {
        this.parameterLibraryParser = parameterLibraryParser;
    }
}
